package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterExportHistoryPageUtil extends
		SeleniumPageUtil {

	public final static By CQE_SPAN_TITLE = By.id("Quoter_QuoteList1_btnRebuildExportHistory");
	public final static By CQE_DIV_RESULT= By.xpath("//*[@id='Quoter_QuoteList1_lblPaging']/div");
	public final static By CQE_TD_TITLE= By.xpath("//*[@id='Quoter_QuoteList1_pnlPage']/table/tbody/tr/td[4]");
	public final static By CQE_LIST_SCOPE= By.id("Quoter_QuoteList1_lblScope");
	public final static By CQE_FILTER_INVOICED = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/div/img[1]");
	public final static By CQE_FILTER_PROBLEM = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]/div/img[1]");
	public final static By CQE_FILTER_CONTRACTID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/div/img[1]");
	public final static By CQE_FILTER_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/div/img[1]");
	public final static By CQE_FILTER_REV_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/div/img[1]");
	public final static By CQE_FILTER_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/div/img[1]");
	public final static By CQE_FILTER_BILL_CYCLE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/div/img[1]");
	public final static By CQE_FILTER_CPO = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/div/img[1]");
	public final static By CQE_FILTER_OPO = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/div/img[1]");
	public final static By CQE_FILTER_START = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]/div/img[1]");
	public final static By CQE_FILTER_BILLED_THRU = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/div/img[1]");
	public final static By CQE_FILTER_SALES_REP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[16]/div/img[1]");
	public final static By CQE_FILTER_CREATE_BY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[21]/div/img[1]");
	public final static By CQE_LINK_INVOICED = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/a");
	public final static By CQE_LINK_PROBLEM = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]/a");
	public final static By CQE_LINK_CONTRACTID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/a");
	public final static By CQE_LINK_REVISION = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/a");
	public final static By CQE_LINK_SUBVER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/a");
	public final static By CQE_LINK_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/a");
	public final static By CQE_LINK_REV_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/a");
	public final static By CQE_LINK_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/a");
	public final static By CQE_LINK_BILL_CYCLE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/a");
	public final static By CQE_LINK_PERIOD = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]/a");
	public final static By CQE_LINK_CPO = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/a");
	public final static By CQE_LINK_OPO = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/a");
	public final static By CQE_LINK_START = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]/a");
	public final static By CQE_LINK_BILLED_THRU = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/a");
	public final static By CQE_LINK_SALES_REP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[16]/a");
	public final static By CQE_LINK_NUMLINES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[17]/a");
	public final static By CQE_LINK_NET_CHANGE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[18]/a");
	public final static By CQE_LINK_ROUGH_MMC = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[19]/a");
	public final static By CQE_LINK_EXPORT_DATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[20]/a");
	public final static By CQE_LINK_CREATE_BY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[21]/a");
	public final static By CQE_LINK_OF_INVOICES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[22]/a");
	public final static By CQE_LINK_DISC_PCT1 = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[23]/a");
	public final static By CQE_LINK_DISC_PCT2 = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[24]/a");
	public final static By CQE_LINK_DISC_PCT3 = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[25]/a");
	
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_QUOTER});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_QUOTER_EXPORT_MAS});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_QUOTER_EXPORT_MAS));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQE_SPAN_TITLE,CQE_LINK_DISC_PCT3
		});
	}
}
